from django.db import models
from django.core import validators

class Students(models.Model):
    number = number = models.CharField(max_length=12,primary_key=True,validators=[validators.RegexValidator(r'\d{12}',message='请输入正确格式的学号！')])
    name = models.CharField(max_length=16,validators=[validators.MinLengthValidator(2)])
    password = models.CharField(max_length=256,validators=[validators.MinLengthValidator(2)])


    class Meta:
        db_table = 'Students'

